﻿@{
    Layout = null;
    var nodeList = ViewBag.nodeList as List<NB.MGJ.Model.Origins_Node>;

    var CurrentUser = ViewBag.CurrentUser;
    var batchId = ViewBag.batchId;

}

<style>
    #NodeInfoLeft2 > li
    {
        /*border-radius: 20px;*/
        border: 2px solid #E5E5E5;
        margin-top: 5px;
        margin-bottom: 5px;
    }

    .EditLiH1
    {
        padding-left: 10px;
    }

    .EditLiSpan
    {
        padding-left: 10px;
    }

    .EditLiBtnDiv
    {
        text-align: right;
        padding-right: 5px;
    }

        .EditLiBtnDiv > button
        {
            margin-left: 5px;
            margin-right: 5px;
        }

    video, img
    {
        width: 100%;
    }

    .unable
    {
        color: red;
    }

    .moretime
    {
        color: gold;
    }
</style>
<div class="row" style="display: flex; align-items: flex-start">


    <input id="batchId" type="hidden" value="@batchId" />
    <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6" style="overflow-y:auto">
        <ul id="NodeInfoLeft2" style="max-height: 450px; overflow-y: auto; overflow-x: hidden">

            @if (nodeList.Count > 0)
            {
                foreach (var item in nodeList)
                {

                    if (item.ImgUrl != null)
                    {
                        <li class="padding-top-10 padding-bottom-10">
                            <h1 class="EditLiH1">@item.NodeName</h1>
                            <span class="EditLiSpan">@item.NodeContent</span>
                            
                            <p class="EditLiSpan">@item.ChangeDate</p>
                            <img class="EditVideoOrImg" src="@item.ImgUrl">
                            <div class="EditLiBtnDiv">
                                @*<button class="btn btn-primary EditLiBtn" onclick="$.MGJ.ProductBatch.Dialog_EditNode(@item.Id)">修改</button>*@
                                <button class="btn btn-danger" onclick="$.MGJ.NodeAdd.Ajax_NodeDelete(this,@item.Id)">删除</button>
                            </div>
                        </li>
                    }
                    if (item.VideoUrl != null)
                    {
                        <li class="padding-top-10 padding-bottom-10">
                            <h1 class="EditLiH1">@item.NodeName</h1>
                            <span class="EditLiSpan">@item.NodeContent</span>
                            <p class="EditLiSpan">@item.ChangeDate</p>
                            <video class="EditVideoOrImg" src="@item.VideoUrl" controls="controls">
                                您的浏览器不支持video
                            </video>
                            <div class="EditLiBtnDiv">
                                @*<button class="btn btn-primary EditLiBtn" onclick="$.MGJ.ProductBatch.Dialog_EditNode(@item.Id)">修改</button>*@
                                <button class="btn btn-danger" onclick="$.MGJ.NodeAdd.Ajax_NodeDelete(this,@item.Id)">删除</button>
                            </div>
                        </li>
                    }

                }
            }

        </ul>
    </div>


    <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
        <table class="table table-hover table-bordered">
            <thead>
                <tr>
                    <th class="text-center">节点名称</th>
                    <th class="text-center">操作</th>
                </tr>
            </thead>
            <tbody id="TempletNodeList">

                <tr>
                    <td binding="{'text':'NodeName'}"></td>
                    <td><a binding="{'id':'Id','EXTIsEnter':'EXTIsEnter','class':'EXTIsEnter','classHandle':$.MGJ.NodeAdd.IsEnter,'EXTIsPermission':'EXTIsPermission','class':'EXTIsPermission','classHandle':$.MGJ.NodeAdd.IsPermission}" onclick="$.MGJ.NodeAdd.Dialog_AEditNodeInfo('add',this,@batchId)">添加节点</a></td>
                </tr>

            </tbody>
        </table>
    </div>



</div>

<script>

    $(function () {
        refreshTempletList();
    });

    function refreshTempletList() {
       
        var batchId = $("#batchId").val();
        $.MGJ.NodeAdd.Ajax_GetTempletNodeList(batchId);
    }

</script>
